#pragma once
#include <d3d12.h>
#include <dxgi1_4.h>
#include <tchar.h>
#include <stdexcept>
#define should_not_be_here() throw std::runtime_error("should not be here");
#ifdef _DEBUG
#define DX12_ENABLE_DEBUG_LAYER
#endif

#ifdef DX12_ENABLE_DEBUG_LAYER
#include <dxgidebug.h>
#pragma comment(lib, "dxguid.lib")
#endif
#include"Device.h"
#include <vector>
#include"CommandList.h"
#include "imgui.h"
namespace Bonnie{
    class Framework {

        ComPtr<ID3D12DescriptorHeap> mSrvDescHeap;
        std::vector<CommandList::SharedPtr> mCmds;
        uint32_t mCurrentFrame = 0;
        static  Framework* mIns;

    protected:
        uint32_t mMaxFrame;
        Framework();
    public:
        virtual LRESULT MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
        static Framework* get();
        virtual ~Framework() {}
        virtual void init();
 
        virtual void update(CommandList::SharedPtr pCmd) = 0;
        void run();
    };
}
